package kr.hkit.powerjava.chapter12.pro;

import java.util.Random;

class Shape1 implements Drawable {
	protected int x;
	protected int y;
	@Override
	public void draw() {
		
	}	
}

class Rectangle1 extends Shape1 implements Drawable {
	private int width;
	private int height;
	@Override
	public void draw() {
		System.out.println("Rectangle Draw");
	}
}

class Triangle1 extends Shape1 implements Drawable {
	private int base;
	private int height;
	@Override
	public void draw() {
		System.out.println("Triangle Draw");
	}
}

class Circle1 extends Shape1 implements Drawable {
	private int radius;
	@Override
	public void draw() {
		System.out.println("Circle Draw");
	}
}

public class DrawableTest {
	private static Drawable[] arrayOFDrawables;
	public static void main(String[] args) {
		init();
		drawRandom();
	}
	
	public static void init() {
		arrayOFDrawables = new Drawable[3];
		arrayOFDrawables[0] = new Rectangle1();
		arrayOFDrawables[1] = new Triangle1();
		arrayOFDrawables[2] = new Circle1();
	}
	
	public static void drawRandom() {
			Random rnd = new Random();
			arrayOFDrawables[rnd.nextInt(3)].draw();
	}
}
